const state = {
  houseId: '',  //入库厂库id
  areasName:'',//入库厂库名称
  moterInfo:{},  //入库物资信息
  materialList:[],
  storeMalList:[],
  recordType:'',//状态
  userName:'',
  deptName:'',
  purpose:'',
  selectMater:null
}

const mutations = {
  setMoterInfo: (state, repairInfo) => {
    state.moterInfo = repairInfo
  },
  setHouseId: (state, repairInfo) => {
    state.houseId = repairInfo
  },
  setAreasName: (state, repairInfo) => {
    state.areasName = repairInfo
  },
  setSelectMater: (state, mater) => {
    state.selectMater = mater
  },
  setPurpose: (state, repairInfo) => {
    state.purpose = repairInfo
  },
  setUserName: (state, repairInfo) => {
    state.userName = repairInfo
  },
  setDeptName: (state, repairInfo) => {
    state.deptName = repairInfo
  },

  setRecordType: (state, repairInfo) => {
    state.recordType = repairInfo
  },
  setMaterialList: (state, repairInfo) => {
	  if(repairInfo.length===0){
		  state.materialList=repairInfo
	  }else{
		state.materialList.push(repairInfo)
	  }
  },
  setStoreMalList: (state, list) => {
    state.storeMalList = list
  },
}

const getters = {
  getStoreMalList (state) {
    return state.storeMalList
  }
}
const actions = {}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}
